/**
 * 2025/01/01 - 2025/12/31
 */
package com.snail.server.iam.error;

import com.snail.starter.commons.error.IErrorCode;
import lombok.Getter;
import lombok.ToString;

/**
 * @author zgadmin
 * @date 2025/9/24 18:37
 */
@Getter
@ToString
public enum IamErrorCode implements IErrorCode {

    ACCOUNT_NOT_EXISTS(1, "account not exists:%s"),
    ACCOUNT_DISABLE(2, "account disable"),
    PASSWORD_ERROR(3, "password error"),
    APP_NOT_EXISTS(4, "app not exists:%s"),
    APP_DISABLE(5, "app disable"),
    USER_NOT_EXISTS(6, "user not exists:%s"),
    USER_DISABLE(7, "user disable"),
    USER_NOT_BIND_TENANT(8, "user not bind tenant"),
    USER_AUTHORIZATION_ERROR(9, "user authorization error"),
    APP_NOT_EXISTS_NO_PARAM(10, "app not exists"),
    ;

    private final Integer code;

    private final String defaultMessage;

    private final String bundleName = "iam";

    IamErrorCode(Integer code, String defaultMessage) {
        this.code = code;
        this.defaultMessage = defaultMessage;
    }

    public Integer getCode() {
        return 20000000 + code;
    }

}